package com.fengling.service.impl;

import com.fengling.Pojo.Emp;
import com.fengling.dao.EmpDao;
import com.fengling.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;




public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpDao empDao;

    @Override
    public List<Emp> serviceEmp() {
        List<Emp> empList = empDao.listEmp();
        empList.stream().forEach(emp -> {
            String gender = emp.getGender();
            if ("1".equals(gender)) {
                emp.setGender("男");

            } else if ("2".equals(gender)) {
                emp.setGender("女");

            }

            String job = emp.getJob();
            if ("1".equals(job)) {
                emp.setJob("讲师");

            } else if ("2".equals(job)) {
                emp.setJob("班主任");

            } else if ("3".equals(job)) {
                emp.setJob("就业指导");
            }


        });
        return empList;
    }
}
